$(function(){
    setLoginPlace();
    $('form').on('valid.form', sendLogin);
});
function setLoginPlace() {
    var login = $('#login');
    var win = $(window);
    var doc = $('body');
    if(win.height() >= doc.height()) {
        login.addClass('loginCenter');
    } else {
        login.removeClass('loginCenter');
    }
    login.removeClass('hide');
}
function sendLogin() {
    var account = $('#op_account').val();
    var password = $('#op_password').val();
    $.post(urlMap.login, {"op_account": account, "op_password": password}, function(data){
        if(data.status == 10000) {
            location.href = urlMap.index;
        } else {
            layer.alert(data.errmsg, 8);
        }
    }, 'json');
    return false;
}